package com.huiying.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiying.entity.entity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    @Select("SELECT content FROM message WHERE conversation_id = #{conversationId} ORDER BY created_time DESC LIMIT 1")
    Message findLastMessageByConversationId(Long id);
    // 自定义方法（如果需要）
}